<template>
    <div id="app">
        <!-- <keep-alive exclude="List,Login">
			<router-view></router-view>
		</keep-alive> -->
        <router-view></router-view>
    </div>
</template>

<script type="text/javascript">
import { getWxAgentConfig } from "@/api/user";
export default {
    data: function () {
        return {};
    },
    created: function () {
        if (document.getElementById("Loading")) {
            document.getElementById("Loading").remove();
        }
        this.wxConfig();
    },
    methods: {
        wxConfig() {
            getWxAgentConfig({
                url: location.href.split("#")[0],
                code: "launchMiniprogram,checkJsApi,shareWechatMessage",
            })
                .then((res) => {
                    const data = JSON.parse(res.data);
                    wx.agentConfig({
                        corpid: "wwdc0bc731d475dfb8", // 必填，企业微信的corpid，必须与当前登录的企业一致
                        agentid: "1000156", // 必填，企业微信的应用id （e.g. 1000247）
                        timestamp: data.timestamp, // 必填，生成签名的时间戳
                        nonceStr: data.nonceStr, // 必填，生成签名的随机串
                        signature: data.signature, // 必填，签名，见附录-JS-SDK使用权限签名算法
                        jsApiList: ["launchMiniprogram", "checkJsApi", "shareWechatMessage"], //必填，传入需要使用的接口名称
                        success: function () {
                            console.log(res, "agentConfig---success");
                        },
                        fail: function (err) {
                            console.log(err, "agentConfig---fail");
                            if (err.errMsg.indexOf("function not exist") > -1) {
                                console.log(err.errMsg, "fail");
                            }
                        },
                    });
                })
                .catch((err) => {
                    console.log(err);
                });
        },
    },
};
</script>

<style lang="scss">
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
}

.page {
    background-color: #fff;
    width: 100%;
    max-width: 750px !important;
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 30px;
}

.logo {
    width: 100%;
    height: 100px;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 35px 30px;
    box-sizing: border-box;

    .logo-img {
        width: 177px;
        height: 30px;
    }

    .right-ic {
        display: flex;
        align-items: center;
        font-size: 24px;
        color: #fff;

        img {
            width: 30px;
            height: 30px;
            margin-right: 10px;
        }
    }
}
.van-cell,
.van-loading__text,
.van-list__finished-text {
    font-size: 24px;
}
.van-toast {
    padding: 30px 40px !important;
    font-size: 24px !important;
}
.van-list__finished-text {
    margin-top: 24px;
}
.van-loading__spinner {
    width: 38px !important;
    height: 38px !important;
}
.van-dialog {
    width: 80% !important;
    padding: 80px 58px;
    box-sizing: border-box;

    .van-dialog__header {
        font-size: 36px;
        color: #333333;
        font-weight: bold;
        margin-bottom: 30px;
    }

    .van-dialog__content {
        color: #666666;
        margin-bottom: 34px;
        .van-dialog__message {
            line-height: 34px;
            font-size: 22px;
        }
    }

    .van-goods-action-button--danger {
        width: 80% !important;
        height: 74px !important;
        font-size: 24px;
        color: #fff;
        background: #1f4456 !important;
        border-radius: 10px;
    }
}
.van-popup {
    .van-picker-column__item {
        font-size: 24px;
    }
    .van-picker__toolbar {
        height: 68px !important;
    }
    .van-picker__cancel,
    .van-picker__title,
    .van-picker__confirm {
        font-size: 26px;
        height: 100%;
        line-height: 68px !important;
    }
}
.van-button {
    font-size: 24px !important;
}
</style>
